package com.kamistoat.meimeimall.meimeimallproduct.aliyunVideo.service;

import com.aliyuncs.exceptions.ClientException;
import com.kamistoat.meimeimall.common.To.AliyunVideoTo.SaveAliVideoInfoTo;
import com.kamistoat.meimeimall.common.To.AliyunVideoTo.VideoUploadAuthRequestTo;
import com.kamistoat.meimeimall.common.To.AliyunVideoTo.VideoUploadAuthResponseTo;
import com.kamistoat.meimeimall.common.utils.R;

public interface GetVideoUploadService {
    /**
     * 后端与阿里云通信，获取视频上传地址和凭证
     *
     * @param videoUploadAuthRequestTo
     * @return
     */
    VideoUploadAuthResponseTo getVideoUpload(VideoUploadAuthRequestTo videoUploadAuthRequestTo) throws ClientException;

    /**
     * 后端与阿里云通信，刷新过期的上传地址和凭证
     *
     * @param videoId 暂停上传的videoId
     * @return
     */
    VideoUploadAuthResponseTo refreshVideoUpload(String videoId) throws ClientException;

    /**
     * 前端直连阿里云上传视频完成后，后端将视频信息保存到数据库中
     *
     * @param infoTo
     * @return
     */
    R saveAliVideoInfo(SaveAliVideoInfoTo infoTo);
}
